package main;

import java.awt.geom.Point2D;
import java.util.ArrayList;

public class Function4 implements Function {

	private static int sign = 1;
	
	public static int getSign() {
		return sign;
	}

	public static void setSign(int sign) {
		Function4.sign = sign;
	}

	@Override
	public double evaluate(double x) {
		if(sign == 1){
			return (x/(Math.cos(x)+2))+5;
		}else {
			return -(x/(Math.cos(x)+2))-5;
		}
		
	}

	@Override
	public Double maxima() {
		return new Double(3.4499);
	}

	@Override
	public Double minima() {
		return new Double(-3.4499);
	}

}
